<template>
  <div>
    <lz-tree
      ref="lzTree"
      :replaceFields="{
        key: 'key',
        title: 'title',
        children: 'children',
      }"
      @click="nodeClick"
    >
    </lz-tree>
  </div>
</template>
<script>
export default {
  data() {
    return {
      treeData: [
        {
          title: "Node1",
          value: "0-0",
          key: "0-0",
          children: [
            {
              value: "0-0-1",
              key: "0-0-1",
              title: "title",
            },
            {
              title: "Child Node2",
              value: "0-0-2",
              key: "0-0-2",
            },
          ],
        },
        {
          title: "Node2",
          value: "0-1",
          key: "0-1",
        },
      ],
    };
  },
  created() {},
  mounted() {
    setTimeout(() => {
       this.$refs.lzTree.init(this.treeData);
    }, 3000);
  },
  methods: {
     nodeClick(param) {
      console.log(param);
    },
    
  },
};
</script>
<style></style>
